package com.wencai.bean;

/**
 * @author wangpan
 * @date 2023/4/17
 */
public class WriteOutStock implements Comparable<WriteOutStock> {
    private String name;
    private int times;
    private Double maxIncrement;
    private String firstDate;
    private Double firstIncrement;
    private String secDate;
    private Double secIncrement;
    private String lastDate;
    private Double lastIncrement;

    public WriteOutStock(String name, int times, Double maxIncrement, String firstDate, Double firstIncrement, String secDate, Double secIncrement, String lastDate, Double lastIncrement) {
        this.name = name;
        this.times = times;
        this.maxIncrement = maxIncrement;
        this.firstDate = firstDate;
        this.firstIncrement = firstIncrement;
        this.secDate = secDate;
        this.secIncrement = secIncrement;
        this.lastDate = lastDate;
        this.lastIncrement = lastIncrement;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getTimes() {
        return times;
    }

    public void setTimes(int times) {
        this.times = times;
    }

    public Double getMaxIncrement() {
        return maxIncrement;
    }

    public void setMaxIncrement(Double maxIncrement) {
        this.maxIncrement = maxIncrement;
    }

    public String getFirstDate() {
        return firstDate;
    }

    public void setFirstDate(String firstDate) {
        this.firstDate = firstDate;
    }

    public Double getFirstIncrement() {
        return firstIncrement;
    }

    public void setFirstIncrement(Double firstIncrement) {
        this.firstIncrement = firstIncrement;
    }

    public String getSecDate() {
        return secDate;
    }

    public void setSecDate(String secDate) {
        this.secDate = secDate;
    }

    public Double getSecIncrement() {
        return secIncrement;
    }

    public void setSecIncrement(Double secIncrement) {
        this.secIncrement = secIncrement;
    }

    public String getLastDate() {
        return lastDate;
    }

    public void setLastDate(String lastDate) {
        this.lastDate = lastDate;
    }

    public Double getLastIncrement() {
        return lastIncrement;
    }

    public void setLastIncrement(Double lastIncrement) {
        this.lastIncrement = lastIncrement;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("WriteOutStock{");
        sb.append("name='").append(name).append('\'');
        sb.append(", times=").append(times);
        sb.append(", maxIncrement=").append(maxIncrement);
        sb.append(", firstDate='").append(firstDate).append('\'');
        sb.append(", firstIncrement=").append(firstIncrement);
        sb.append(", secDate='").append(secDate).append('\'');
        sb.append(", secIncrement=").append(secIncrement);
        sb.append(", lastDate='").append(lastDate).append('\'');
        sb.append(", lastIncrement=").append(lastIncrement);
        sb.append('}');
        return sb.toString();
    }

    @Override
    public int compareTo(WriteOutStock o) {
        int i = Integer.valueOf(o.times).compareTo(times);
        if (i != 0) {
            return i;
        }
        if (o.secDate != null && secDate != null) {
            return secDate.compareTo(o.secDate);
        }
        return firstDate.compareTo(o.firstDate);
    }
}
